/*******************************************************************************
 * Copyright (c) 2014 Francesco Gabbrielli (http://www.francescogabbrielli.it).
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Francesco Gabbrielli - initial API and implementation
 ******************************************************************************/
package it.francescogabbrielli.android.solidalapp;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * Registered device
 */
@Entity
public class Device extends Operation {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	
	/**
	 * The Google Cloud Messaging registration token for the device. This token
	 * indicates that the device is able to receive messages sent via GCM.
	 */
	private String registrationId;
	
	/**
	 * Some identifying information about the device, such as its manufacturer
	 * and product name.
	 */
	private String information;
		
	/**
	 * Telephone number (if visible)
	 */
	private String telephoneNumber;
	
	/**
	 * App version installed
	 */
	private int appVersion;


	public Long getId() {
		return id;
	}
	
	public String getRegistrationId() {
		return registrationId;
	}
	
	public void setRegistrationId(String registrationId) {
		this.registrationId = registrationId;
	}
	
	public String getInformation() {
		return information;
	}
	
	public void setInformation(String information) {
		this.information = information;
	}
	
	public String getTelephoneNumber() {
		return telephoneNumber;
	}
	
	public void setTelephoneNumber(String telephoneNumber) {
		this.telephoneNumber = telephoneNumber;
	}
	
	public int getAppVersion() {
		return appVersion;
	}
	
	public void setAppVersion(int appVersion) {
		this.appVersion = appVersion;
	}
	
	@Override
	public String toString() {
		return getInformation() + ": " + getRegistrationId();
	}
	
}
